package com.sgroupware.modules.car.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.simpleframe.persistence.hibernate.Page;
import com.simpleframe.persistence.hibernate.Searcher;
import com.sgroupware.modules.car.CarInfor;
import com.sgroupware.modules.car.dao.CarInforDAO;

public class CarInforService {

	@Autowired
	private CarInforDAO carInforDAO;
	
	public CarInfor getById(long id){
		return carInforDAO.findById(id);
	}
	
	@Transactional(propagation = Propagation.REQUIRED)
	public void deletes(Long[] ids){
		carInforDAO.deletes(ids);
	}
	
	@Transactional(propagation = Propagation.REQUIRED)
	public void create(CarInfor carInfor){
		carInforDAO.save(carInfor);
	}
	
	@Transactional(propagation = Propagation.REQUIRED)
	public void update(CarInfor carInfor){
		carInforDAO.update(carInfor);
	}
	
	//以上自动生成
	
	public Page getPage(Searcher searcher){
		return carInforDAO.getPage(searcher);
	}

}
